package factorymode.main.java.factory.specificfactory;

import factorymode.main.java.factory.Computer;
import factorymode.main.java.factory.Factory;
import factorymode.main.java.factory.Phone;

/**
 * 工厂模式，生产手机及电脑
 * @author YC
 */
public class AppleFactory implements Factory {
    @Override
    public Phone createPhone() {
        return new ApplePhone();
    }
    @Override
    public Computer createComputer() {

        return new AppleComputer();
    }
}


class AppleComputer implements Computer {
    @Override
    public void showComputer() {
        System.out.println("生产苹果电脑");
    }
}


class ApplePhone implements Phone {
    @Override
    public void showPhone(){
        System.out.println("生产苹果手机");
    }
}